import { _decorator, Component, director, game, Node } from 'cc';
import { audioTool } from '../utils/audioTool';
import { nodePool } from '../utils/nodePool';
import { gameConfig } from '../data/gameConfig';
const { ccclass, property } = _decorator;

@ccclass('settings')
export class settings extends Component {
    onEnable() {
        if (!gameConfig.isGame) {
            this.node.getChildByPath("popUI/backHome").active = false;
        }else{
            this.node.getChildByPath("popUI/backHome").active = true;
        }
    }
    // 关闭界面
    close() {
        audioTool.ins.playSound("btn");
        nodePool._ins.huiShouNode(this.node);
    }
    /**
 * 返回首页
 */
    backHome() {
        audioTool.ins.stopMusic();
        director.loadScene('main');
        gameConfig.isGame = 0;
    }
}


